//package com.base.component.app.pay.weixin;
//
//import com.base.component.app.pay.bo.PayWxJsapiBO;
//import com.wechat.pay.java.core.Config;
//import com.wechat.pay.java.service.refund.RefundService;
//import com.wechat.pay.java.service.refund.model.AmountReq;
//import com.wechat.pay.java.service.refund.model.CreateRequest;
//import com.wechat.pay.java.service.refund.model.Refund;
//import com.wechat.pay.java.service.refund.model.RefundNotification;
//import com.wechat.pay.java.service.refund.model.Status;
//
///**
// * 微信退款
// * 
// * @author mac
// *
// */
//public class WeixinRefundPayHandler {
//	
//	@Override
//	public boolean support(String name, Class<?> prototype) {
//		return true;
//	}
//	
//	public void refund(Long refundId,Long orderPayId,Integer refundAmount,Integer totalAmount) {
//		Config config = getConfig();
//		RefundService service = new RefundService.Builder().config(config).build();
//		CreateRequest request = new CreateRequest();
//		AmountReq amountReq = new AmountReq();
//		amountReq.setRefund(Long.valueOf(refundAmount));
//		amountReq.setTotal(Long.valueOf(totalAmount));
//		amountReq.setCurrency("CNY");
//		request.setAmount(amountReq);
//		request.setOutTradeNo(String.valueOf(orderPayId));
//		request.setOutRefundNo(String.valueOf(refundId));
//		request.setNotifyUrl(weixinPayDomain + "/pay/refund/notify/"+refundId);
//		Refund refund = service.create(request);
//		Refund refundResponse = new Refund();
//		refundResponse.setStatus(refund.getStatus());
//		if (refundResponse.getStatus().equals(Status.SUCCESS)){
//
//		}
//	}
//
//	public boolean verify(PayWxJsapiBO param) {
//		RefundNotification refund = parseNotify(RefundNotification.class);
//		return Status.SUCCESS.equals(refund.getRefundStatus());
//	}
//
//}
